import request from '@/utils/request'

/**
 * 获取图标列表
 * @returns {Promise}
 */
export function getIconList() {
  return request({
    url: '/system/icon/list',
    method: 'get'
  })
}

/**
 * 上传自定义图标
 * @param {FormData} data 图标文件数据
 * @returns {Promise}
 */
export function uploadIcon(data) {
  return request({
    url: '/system/icon/upload',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

/**
 * 删除自定义图标
 * @param {string} name 图标名称
 * @returns {Promise}
 */
export function deleteIcon(name) {
  return request({
    url: `/system/icon/${name}`,
    method: 'delete'
  })
} 